package com.test.models;

import java.util.List;

/**
 * City
 * 
 * @author ezuccon
 * @category Models
 * @version 1.0
 * @since 12/03/2013
 */
public class City {
	/**
	 * id
	 */
	private int id;

	/**
	 * name
	 */
	private String name;

	/**
	 * routes
	 */
	private List<Route> routes;

	/**
	 * Constructor
	 */
	public City() {
		super();
	}

	/**
	 * Constructor
	 * 
	 * @param nameValue
	 */
	public City(String nameValue) {
		super();
		this.name = nameValue;
	}

	/**
	 * Constructor
	 * 
	 * @param idValue
	 * @param nameValue
	 * @param routesValue
	 */
	public City(int idValue, String nameValue, List<Route> routesValue) {
		super();
		this.id = idValue;
		this.name = nameValue;
		this.routes = routesValue;
	}

	/**
	 * @return the id
	 */
	public final int getId() {
		return id;
	}

	/**
	 * @param idValue
	 *            the id to set
	 */
	public final void setId(int idValue) {
		this.id = idValue;
	}

	/**
	 * @return the name
	 */
	public final String getName() {
		return name;
	}

	/**
	 * @param nameValue
	 *            the name to set
	 */
	public final void setName(String nameValue) {
		this.name = nameValue;
	}

	/**
	 * @return the routes
	 */
	public final List<Route> getRoutes() {
		return routes;
	}

	/**
	 * @param routesValue
	 *            the routes to set
	 */
	public final void setRoutes(List<Route> routesValue) {
		this.routes = routesValue;
	}

	@Override
	public final int hashCode() {
		return super.hashCode();
	}

	@Override
	public final boolean equals(Object obj) {
		// valida tipo de objeto
		if (!(obj instanceof City)) {
			return false;
		}

		// valida por nombre
		return (this.getName().equals(((City) obj).getName()));
	}
}
